package com.it.App.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.it.App.eneity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @Author: CaoYouGen
 * @DateTime: 2023/11/28/10:43
 * @注释: TODO
 **/
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select r.role_name from user u left join user_role ur on ur.user_id = u.user_id " +
            "left join role r on r.role_id = ur.role_id where u.username = #{username}")
    Set<String> selectAllRoleNamesByUsername(String username);
}
